package com.wkbb.sports.thread;

import com.wkbb.common.dto.ResultDTO;
import com.wkbb.sports.feign.BasicFeignService;
import com.wkbb.sports.service.AchievementService;
import lombok.extern.slf4j.Slf4j;

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;

@Slf4j
public class AchievementScoreTermTask implements Callable<ResultDTO> {

	private AchievementService achievementService;

	private Long orgId;

	private Long termId;

	public AchievementScoreTermTask(AchievementService achievementService, Long orgId, Long termId) {
		this.achievementService = achievementService;
		this.orgId = orgId;
		this.termId = termId;
	}

	@Override
	public ResultDTO<Map<String,Object>> call() throws Exception {
		log.info("*******AchievementScoreTermTask begin**********");

		ResultDTO resultDTO = null;
		try {
			log.info("---当前线程----:{}---开启启动---orgId:{} termId:{}",Thread.currentThread().getName(),orgId,termId);
			achievementService.doTermAchievementScore(orgId,termId);

		} catch (Exception e) {
			log.error("******AchievementScoreTermTask******", e);
		}
		log.info("*******AchievementScoreTermTask end**********");
		return resultDTO;
	}
}
